bugfix: update hashes in butch.db also when rebuilding

diff --git a/butch.c b/butch.c
index 70d8ba7..3da61b3 100644
--- a/butch.c
+++ b/butch.c
@@ -774,13 +774,13 @@ static void mark_finished(pkgstate* state, stringptr* name) {
 	if(idx == -1) {
 		stringptrlist_add_strdup(state->installed_packages.names, name);
 		stringptrlist_add_strdup(state->installed_packages.hashes, SPMAKE(hash, 128));
-		write_installed_dat(state);
 	} else { /* update hash */
 		stringptr* e = stringptrlist_get(state->installed_packages.hashes, idx);
 		free(e->ptr);
 		char* e2 = stringptr_strdup(SPMAKE(hash, 128));
 		stringptrlist_set(state->installed_packages.hashes, idx, e2, 128);
 	}
+	write_installed_dat(state);
 }
 
 static void prepare_update(pkgstate* state, stringptrlist* packages2install) {
-- 
2.7.3

